#include <stdio.h>
// 将一个字符串反转后输出
#include <string.h>
void revere(char arr[])

{
    int sz = strlen(arr) - 1;
    int left = 0;
    int right = sz - 2;
    while (left < right)
    {
        char temp = arr[left];
        arr[left] = arr[right];
        arr[right] = temp;
        left++;
        right--;
    }

    printf("%s", arr);
}
int main()
{
    char arr[] = "abcdef";
    /* int sz = sizeof(arr) / sizeof(arr[0]); // #include <string>    sz = string(arr)-1;
    int left = 0;
    int right = sz - 2;
    while (left < right)
    {
        char temp = arr[left];
        arr[left] = arr[right];
        arr[right] = temp;
        left++;
        right--;
    } */
    // 用函数实现翻转
    revere(arr);
    return 0;
}